<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>处理工作者线程错误</title>
</head>
<body>
  <script>
    const worker = new Worker('./27_2_8_worker.js');
    worker.onerror = console.log;
    // ErrorEvent {message: "Uncaught Error: foo"}
  </script>
</body>
</html>